//
// Created by Chen qin lang on 2018/7/6.
//

#ifndef CQAUDIO_WLQUEUE_H
#define CQAUDIO_WLQUEUE_H

#include "pthread.h"
#include "queue"
#include "WlPlayStat.h"
#include "android/log.h"
#define LOGE(format, ...) __android_log_print(ANDROID_LOG_ERROR,"(><)",format, ##__VA_ARGS__);

extern "C"{
#include <libavcodec/avcodec.h>
};
class WlQueue {
public:
    pthread_cond_t cond;
    pthread_mutex_t mutex;
    std::queue<AVPacket*> packQueue;
    WlPlayStat * playStat;

public:
    WlQueue( WlPlayStat * playStat);
    ~WlQueue();
    void putAvpacket(AVPacket *avPacket);
    int getAvpacket(AVPacket *avPacket);
    int getAvpacketSize();

    void clearQueue();
};


#endif //CQAUDIO_WLQUEUE_H
